%% Figure 1. Brazil: Schooling Indicators of Children 7-14 years old in 2000
% Bar Graphs to Represent school attendance and school lag


school_att_2000 = [0.754573	 0.8576871	 0.8910586	 0.9308619 	 0.9534278
                    0.8256822	0.8761763	0.8972504	0.9277845	0.9149754
                    0.8612381 	0.9070063	0.9294889 	0.9546762	0.973019]
school_att_2000=transpose(school_att_2000*100);


school_lag_2000 = [2.141833	    1.384134 	0.8037476	0.5042986	0.0947656
                    1.580013	1.287246	0.9492535	0.6365061 	0.5603806
                    1.552962	1.090639	0.6406313	0.2694268	-0.0128862];
school_lag_2000=transpose(school_lag_2000);



figure(1)
newcolors = [0 0 0
            0.4 0.4 0.4
            1 1 1];
gray=colororder(newcolors);
bar(school_att_2000)
ylim([70 100])
title('School Attendance','FontSize',12)
xlabel('parental years of schooling','FontSize',12)
ylabel('children school attendance (%)','FontSize',12)
legend( 'rural','slum', 'city','Location','northwest','FontSize',12)
somenames={'0 ',' 1 to 4 ', '5 to 8','9 to 11 ',' 12 or +'};
set(gca,'xticklabel',somenames,'FontSize',12)
applyhatch(gcf,'x/.',gray);
print -depsc SchoolAttendance2000


figure(2)
newcolors = [0 0 0
            0.4 0.4 0.4
            1 1 1];
gray=colororder(newcolors);
bar(school_lag_2000)
ylim([-0.1 2.5])
title('Years Behind in School','FontSize',12)
xlabel('parental years of schooling','FontSize',12)
ylabel('children school lag (years)','FontSize',12)
legend( 'rural','slum', 'city','Location','northeast','FontSize',12)
somenames={'0 ',' 1 to 4 ', '5 to 8','9 to 11 ',' 12 or +'};
set(gca,'xticklabel',somenames,'FontSize',12)
applyhatch(gcf,'x/.',gray);
print -depsc SchoolLag2000